<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="{{__PUBLIC__}}/Home/css/common_header.css"/>
		<link rel="stylesheet" type="text/css" href="{{__PUBLIC__}}/Home/css/common_bottom.css"/>
		<link rel="stylesheet" type="text/css" href="{{__PUBLIC__}}/Home/css/ShoppingCar.css"/>
		<script type="text/javascript" src="{{__PUBLIC__}}/Home/js/jquery-1.8.2.min.js"></script>
		<script type="text/javascript" src="{{__PUBLIC__}}/Home/js/index.js"></script>
	</head>
	<body>
	<!--顶部登陆-->
	<div class="page_top_nav_long">
		<div class="page_top_nav">
			<!--顶部左边-->
			<ul class="page_top_nav_l">
				<li class="s-hw" style="background-image: none;padding-left: 0px;"><a href="index.php" style="padding-left: 0px;">华为官网</a></li>
			</ul>
			<!--顶部右边-->
			<ul class="page_top_nav_r">
				{{if value="isset($_SESSION['username'])"}}
				<!--如果有登陆，才显示-->
				<li style="display: list-item;" class="s-user hide" id="login_status">
					<div class="s-dropdown">
						<div class="h">
							<a href="{{U('User/index')}}" id="customer_name" rel="nofollow" timetype="timestamp" class="link-user">{{$_SESSION['username']}}</a>
							 <em class="vip-state" id="vip-info">
								<a href="#" title="VMALL V0会员" id="vip-Active"><i class="icon-vip-level-0"></i>&nbsp;</a>
							</em>
							<s></s>
						</div>
						<div class="b">
							<p><a href="{{U('User/index')}}" target="_blank" id="user-center">我的华为帐号</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href="{{U('Login/out')}}">退出</a></p>
						</div>
					</div>
				</li>
				{{else}}
				<!--如果没有登录才会显示-->
				<li class="login">
					<a href="{{U('Login/index')}}" class="login">登陆</a>
					<a href="{{U('Register/index')}}" class="page_top_nav_r_a">注册</a>
				</li>
				{{endif}}
				<li>
					<a href="{{U('User/index')}}" class="page_top_nav_r_a">我的订单</a>
				</li>
			</ul>	
		</div>
	</div>
	<!--顶部登录结束-->
	<!--logo-->
	<div class="top_logo_long">
		<div class="top_logo">
			<div class="top_logo_l">
				<div class="logo_img">
					<a href="index.php">
						<img src="{{__PUBLIC__}}/Home/images/newLogo.png"/>
					</a>
				</div>
			</div>
			<div class="top_logo_r">
				<div class="progress-area">
					<div class="progress-cart"></div>
					<div class=""></div>
					<div></div>
				</div>
			</div>
		</div>
	</div>
	<!--购物车-->
	<div class="layout">
		<div class="sc-list">
			<!--复制的-->
			<div class="sc-pro-list">
            <!-- 20131223-订单-商品-标题-start -->
            <div class="sc-pro-title-area">
                <div class="h">
                    <table border="0" cellpadding="0" cellspacing="0">
                        <thead>
                            <tr>
                                <th class="tr-check">
                                	<!--<input id="checkAll-top" class="vam" autocomplete="off" checked="" type="checkbox">-->
                                </th>
                                <th class="tr-pro">商品</th>
                                <th class="tr-price">单价<em>（元）</em></th>
                                <th class="tr-quantity">数量</th>
                                <th class="tr-subtotal">小计<em>（元）</em></th>
                                <th class="tr-operate">操作</th>
                            </tr>
                        </thead>
                    </table>
                </div>
            </div>
            {{if value="!$session['goods']"}}
            <!--如果购物车里面没有商品-->
            <div id="cart-empty-msg" class="sc-empty-area">
			            亲，您购物车里还没有物品哦，快去逛逛吧！
			</div>
			{{endif}}
			{{if value="$session['goods']"}}
            <!--如果购物车有商品-->
            <!-- 20131223-订单-商品-标题-end -->
		<form id="cart-form" autocomplete="off" method="get">
			<input name="state" value="1" type="hidden">
				<span id="cart-list">
				<!--product-list start-->
				<!--{{sp($session['goods'])}}-->
				{{foreach from="$session['goods']" key="$k" value="$v"}}
				<div class="sc-pro-area selected">
					<table border="0" cellpadding="0" cellspacing="0">
						<tbody><tr class="sc-pro-item">
							<td rowspan="1" class="tr-check">
								<!--<input id="box-5403" class="checkbox" name="skuIds"  value="5403"  checked="" type="checkbox">-->
							</td>
							<td class="tr-pro">
								<div class="pro-area clearfix">
									<p class="p-img">
										<a  target="_blank" href="" seed="cart-item-name">
											<img src="{{__ROOT__}}/{{$v['pic']}}" width="63px" height="63px">
										</a>
									</p>
									<p class="p-name">
										<a target="_blank" href="" class="gname" gname="{{$k}}">{{$v['name']}}</a>
									</p>
									<p class="p-sku"><em>颜色：{{$v['options']['颜色']}}</em></p>
									<p class="understock-5403 hide"></p>
								</div>
							</td>
							<td class="tr-price">
								<span>¥{{$v['price']}}</span>
							</td>
							<td class="tr-quantity" rowspan="1"> 
								<div class="sc-stock-area">
									<div class="stock-area">
										<a href="javascript:;" class="icon-minus-3 vam" title="减">
											<span>-</span>
										</a>
										<input style="ime-mode: disabled;" id="quantity-5403" class="shop-quantity text vam" value="{{$v['num']}}" data-skuid="5403" data-type="1" seed="cart-item-num" type="text">
										<a href="javascript:;" class="icon-plus-3 vam" title="加">
												<span>+</span>
										</a>
									</div>
									<p class="normalLimitstock-5403 hide"></p>
								</div>
							</td>
							<td rowspan="1" class="tr-subtotal">
								<b>¥<span class="xiaoji">{{$v['total']}}</span></b>
							</td>
							<td rowspan="1" class="tr-operate">
								<a href="javascript:;" class="icon-sc-del" title="删除">删除</a>
								<!--删除提示-->
									<div class="realdel">
								        <p id="ec_ui_confirm_msg">您确认要删除该商品吗？</p>
								        <div class="popup-button-area">
								        	<a id="ec_ui_confirm_yes" href="{{U('del',array('k'=>$k))}}" class="button-action-yes" title="是"><span>是</span></a>
								        	<a id="ec_ui_confirm_no" href="javascript:;" class="button-action-no" title="否"><span>否</span></a>
								        </div>
								    </div>
								<!--删除提示结束-->
							</td>
						</tr>
						</tbody>
					</table>
				</div>
					{{endforeach}}
				<!--product-list end-->
				</span>
				<!--确认删除商品-->
		<script type="text/javascript">
			$(function(){
				$('.icon-sc-del').click(function(){
					var num = $(this).index();
					$(this).parents().find('.realdel').eq(num).css({'display':'block'});
				})
//					取消删除
				$('.popup-button-area').on('click','#ec_ui_confirm_no',function(){
					var num = $(this).parents().find('#ec_ui_confirm_no').index();
//											alert(num);
					$(this).parent().parent().parent().find('.realdel').css({'display':'none'});
				})
				//商品数量加减
			$('.icon-minus-3').click(function(){ //减
//										1、抓取input里面的textvalue值
				var num = $(this).siblings('.text').val();
				// alert(num);
//										2、抓取购物车里面的单条商品名字
				var name = $(this).parents().find('.gname').attr('gname');
				// alert(name)
				if(num<=1){
					num=1;
				}else{
					num= num-1;
				}
//										发送ajax
				$.ajax({
//											请求方式
					type:"post",
//											发送地址
					url:'{{U('getAjaxmin')}}',
//											发送数据
					data:{num:num,name:name},
//											返回数据类型
					dataType:"json",
//											成功返回数据
					success:function(phpdata){
//				$(this).parents('.tr-quantity').next('td').find('.xiaoji').html(1);
//				$('.endprice').html(phpdata.endprice);
							
						location.reload();
					}
				})
				$(this).siblings('.text').val(num);
				})
			$('.icon-plus-3').click(function(){
//										1、抓取input里面的textvalue值
				var num = $(this).parent('.stock-area').find('.text').val();
//										2、抓取购物车里面的单条商品名字
				var name = $(this).parents().find('.gname').attr('gname');
//										获取库存最大数字
				num= parseInt(num)+1;
//										抓取显示商品数量的的text表单
				var artnum = $('.text').val();
//										alert(artnum);
//										发送ajax
				$.ajax({
//											请求方式
					type:"post",
//											发送地址
					url:'{{U('getAjaxmin')}}',
//											发送数据
					data:{num:num,name:name},
//											返回数据类型
					dataType:"json",
//											成功返回数据
					success:function(phpdata){
//		$(this).parents('.tr-quantity').next('td').find('.xiaoji').html(1);
//		$('.endprice').html(phpdata.endprice);
						// alert(phpdata)
						location.reload();
					}
				})
				var num = $(this).parent().find('.text').val(num);
			})
			$('.text').attr('disabled',true);

		})
		</script>
		</form>
		{{endif}}
			</div>
			{{if value="$session['goods']"}}
			<!--合计-->
			<div id="cart-total-area" class="sc-total-area clearfix">
				<!--<div class="sc-total-control">
					<input id="checkAll-buttom" name="" class="vam" autocomplete="off" checked="" type="checkbox">
						<label class="vam" for="checkAll-buttom">全选</label>
						<a class="vam" href="javascript:;" seed="cart-all-del">删除选中商品</a>
				</div>-->
				<div class="sc-total-price">
					<table border="0" cellpadding="0" cellspacing="0">
						<tbody>
							<tr>
								<th>总计金额：</th>
								<td id="sc-cartInfo-totalOriginalPrice" class="endprice">¥{{$session['total']}}</td>
							</tr>
							<tr>
								<th>共节省：</th>
								<td id="sc-cartInfo-minusPrice">¥0.00</td>
							</tr>
							<tr>
								<th><em>合计(不含运费)：<em></em></em>
								</th>
								<td><b id="sc-cartInfo-totalPrice" class="endprice">¥{{$session['total']}}</b></td>
							</tr>
						</tbody>
					</table>
				</div>
			</div>
			<!--去结算-->
			<div class="sc-action-area clearfix">
				<a class="button-style-4 button-go-shopping-3" href="index.php">继续购物</a>
				<a class="button-style-1 button-go-checkout-2" href="{{U('Order/index')}}" seed="cart-pay">去结算</a>
			</div>
			{{endif}}
		</div>
	</div>
	<!--商城宣传-->
	<div class="slogan">
		<ul>
			<li style="width: 326px;"><i></i>500强企业 品质保证</li>
			<li style="width: 327px;"><i></i>7天退货 15天换货</li>
			<li><i></i>99元起免运费</li>
			<li style="float: right;"><i></i>448家维修网点 全国联保</li>
		</ul>
	</div>
<!--服务-->
	<!--底部友情链接-->
	<div class="footer">
		<div class="footer-warrant-area">
			<p>Copyright © 2011-2015  华为软件技术有限公司  版权所有  保留一切权利  苏B2-20130048号 | 苏ICP备09062682号-9</p>
			<p><a href="">网络文化经营许可证苏网文[2012]0401-019号</a></p>
			<p class="footer-warrant-img">
				<a href=""><img src="{{__PUBLIC__}}/Home/images/certificate_01_112_40.png" alt="" /></a>
				<a href=""><img src="{{__PUBLIC__}}/Home/images/certificate_02_112_40.png" alt="" /></a>
				<a href=""><img src="{{__PUBLIC__}}/Home/images/certificate_03_112_40.png" alt="" /></a>
			</p>
		</div>
	</div>
	</body>
</html>
